package com.uns1066.unsbar.common;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

public class CommonConstant {
	private static ResourceBundle rb = ResourceBundle.getBundle("properties/common");

	public static String getValue(String key) {
		try {
			return rb.getString(key);
		} catch (MissingResourceException e) {
		}
		return null;
	}

	public static int getInt(String key) {
		return getInt(key, 0);
	}

	public static int getInt(String key, int def) {
		String val = getValue(key);
		int value = def;
		if (val != null) {
			value = Integer.valueOf(val).intValue();
		}
		return value;
	}

	public static String getNetworkPath() {
		return getValue("networkPath");
	}

	public static String getLocalPath() {
		return getValue("localPath");
	}

	public static String getFileRoot() {
		return getValue("fileRoot");
	}

	public static String getFileKeyWord() {
		return getValue("fileKeyWord");
	}

	public static int getXWidth() {
		return getInt("xWidth");
	}

	public static int getXHeight() {
		return getInt("xHeight");
	}

	public static int getMWidth() {
		return getInt("mWidth");
	}

	public static int getMHeight() {
		return getInt("mHeight");
	}

	public static int getMobWidth() {
		return getInt("mobWidth");
	}

	public static int getMobHeight() {
		return getInt("mobHeight");
	}

	public static int getFileWidth() {
		return getInt("zoomWidth");
	}

	public static int getFileHeight() {
		return getInt("zoomHeight");
	}

	public static String getFileDeleteDataKeyWord() {
		return getValue("fileDeleteDataKeyWord");
	}

	public static String getFileDeleteSize() {
		return getValue("fileDeleteSize");
	}

	public static String getPublicResources() {
		return getValue("publicResources");
	}

	public static String getPrivateResources() {
		return getValue("privateResources");
	}

	public static String getHostUrl() {
		return getValue("hostUrl");
	}

	public static String getffmpegPath() {
		return getValue("ffmpegPath");
	}

	public static String[] getFileType() {
		String fileType = getValue("uns.upload.fileType");
		return fileType.split(",");
	}
}